<!DOCTYPE html>
<!--suppress ALL -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe体验页面无刷新</title>
    <script>
        function go(){
            //所有的值变量提前获取
            var url=document.getElementById("url").value;
           document.getElementById("window1").src=url;
        }
    </script>

</head>
<body>

   <div>
       <p>请输入地址</p>
       <p>
           <input type="text" id="url" value="https://www.baidu.com/">
           <input type="submit" value="提交" onclick="go()">
       </p>
   </div>
   <div>
       <iframe id="window1" style="width:100%;height:500px"></iframe>
   </div>

</body>
</html>